package com.cddx.logistics.service.impl;

import com.cddx.logistics.domain.vo.PersonTaskStatisticsVo;
import com.cddx.logistics.mapper.PersonTaskStatisticsMapper;
import com.cddx.logistics.service.PersonTaskStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class PersonTaskStatisticsServiceImpl implements PersonTaskStatisticsService {

    @Autowired
    private PersonTaskStatisticsMapper personTaskStatisticsMapper;

    @Override
    public List<PersonTaskStatisticsVo> getPersonTaskStatistics(Integer year, String empName) {
        return personTaskStatisticsMapper.selectPersonTaskStatistics(year, empName);
    }

    @Override
    public Map<String, List<?>> getSelectOptions() {
        Map<String, List<?>> result = new HashMap<>();
        result.put("years", personTaskStatisticsMapper.selectDistinctYears());
        result.put("empNames", personTaskStatisticsMapper.selectDistinctEmpNames());
        return result;
    }
}
